const salt = (length = 8) => Math.random().toString(16).substr(2, length);

const verifyPath = (str) => {
	const path =
		/^[a-zA-Z]:[\\]((?! )(?![^\\/]*\s+[\\/])[\w -]+[\\/])*(?! )(?![^.]*\s+\.)[\w -]+$/;

	const rgeHttp = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/;

	return path.test(str) || rgeHttp.test(str);
};

export {
	salt,
	verifyPath,
};